index=1
def hanoi(n, source, target, auxiliary):
    global index
    if n == 1:
        print(f"将{index}圆盘从 {source} 移动到 {target}")
        index=index+1
    else:
        hanoi(n-1, source, auxiliary, target,)
        print(f"将{index}圆盘从 {source} 移动到 {target}")
        index=index-1
        hanoi(n-1, auxiliary, target, source)

# 调用函数
hanoi(5, 'A', 'C', 'B')